
<template>
  <div class="common-layout">
    <el-container style="width: 100%; height: 100%">
      <el-header class="elheader">
        <el-tag type="danger"
          >欢迎:{{ store.ccstore.userName }},角色为:{{
            store.ccstore.roleName
          }}</el-tag
        >
        <span class="logout">
          <RouterLink to="/">退出登录</RouterLink>
        </span>
      </el-header>
      <el-container>
        <el-col :span="5" >
      
      <el-menu
        default-active="2"
        class="el-menu-vertical-demo"
        router
      >
        <el-sub-menu index="1">
          <template #title>
            <el-icon><location /></el-icon>
            <span>用户管理</span>
          </template>
            <el-menu-item index="/NewUserList">用户列表</el-menu-item>
        </el-sub-menu>
       
          <el-sub-menu index="2">
          <template #title>
            <el-icon><location /></el-icon>
            <span>角色管理</span>
          </template>
            <el-menu-item index="/AddRole">角色添加</el-menu-item>
            <el-menu-item index="/NewRoleListView">角色列表</el-menu-item>
        </el-sub-menu>
      
         <el-sub-menu index="3">
          <template #title>
            <el-icon><location /></el-icon>
            <span>菜单管理</span>
          </template>
            <el-menu-item index="/MenuQueryView">菜单列表</el-menu-item>
            <el-menu-item index="/RoleMenusView">角色列表</el-menu-item>
        </el-sub-menu>
        
        <el-sub-menu index="4">
          <template #title>
            <el-icon><location /></el-icon>
            <span>审批流程</span>
          </template>
            <el-menu-item index="/GetLeaveRequestsView">请假审批列表</el-menu-item>
            <el-menu-item index="/CreateLeaveRequestsView">请假申请</el-menu-item>
            <el-menu-item index="/AppUpdataView">审批页面</el-menu-item>
            <!-- <el-menu-item index="/UpdataLeaveRequestsView">修改申请表</el-menu-item> -->
           
        </el-sub-menu>

           <el-sub-menu index="5">
          <template #title>
            <el-icon><location /></el-icon>
            <span>溯源管理</span>
          </template>
            <el-menu-item index="/GetProductsShoopView">生产信息列表</el-menu-item>
          <!--   <el-menu-item index="/CreateLeaveRequestsView">请假申请</el-menu-item>
            <el-menu-item index="/AppUpdataView">审批页面</el-menu-item> -->
            <!-- <el-menu-item index="/UpdataLeaveRequestsView">修改申请表</el-menu-item> -->
           
        </el-sub-menu>
      
      </el-menu>
    </el-col>


        <el-main>
          <RouterView />
        </el-main>
      </el-container>
    </el-container>
  </div>
  <!-- <RouterView /> -->
</template>
<script setup lang="ts">
import { onMounted, reactive, ref } from "vue";
import { RouterLink, RouterView } from "vue-router";
import HelloWorld from "../components/HelloWorld.vue";
import { useCounterStore } from "@/stores/counter";
import { ElMessage } from "element-plus";
import { useRouter } from "vue-router";
import axios from "axios";

const store = useCounterStore();
const router = useRouter();

</script>
<style scoped>
header {
  line-height: 1.5;
  max-height: 100vh;
}

.logo {
  display: block;
  margin: 0 auto 2rem;
}

nav {
  width: 100%;
  font-size: 12px;
  text-align: center;
  margin-top: 2rem;
}

nav a.router-link-exact-active {
  color: var(--color-text);
}

nav a.router-link-exact-active:hover {
  background-color: transparent;
}

nav a {
  display: inline-block;
  padding: 0 1rem;
  border-left: 1px solid var(--color-border);
}

nav a:first-of-type {
  border: 0;
}

@media (min-width: 1024px) {
  header {
    display: flex;
    place-items: center;
    padding-right: calc(var(--section-gap) / 2);
  }

  .logo {
    margin: 0 2rem 0 0;
  }

  header .wrapper {
    display: flex;
    place-items: flex-start;
    flex-wrap: wrap;
  }

  nav {
    text-align: left;
    margin-left: -1rem;
    font-size: 1rem;

    padding: 1rem 0;
    margin-top: 1rem;
  }
}

.elheader {
  display: flex;
}
.logout {
  margin-left: auto;
  margin-right: 20px;
}
</style>
